
import java.awt.event.MouseEvent;
import javax.swing.JPanel;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Henri
 */
public class sliepka_leti_mala_L extends sliepka_leti{
JPanel jml;
    public sliepka_leti_mala_L(JPanel jml){
        super(jml);
        this.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/morhuhnt_malyL.gif")));
        int y = (int) (20 + Math.random() * 400);
        setBounds(1000, y, 71,62);
    }
     @Override
    public void mousePressed(MouseEvent e) {
        if (e.getButton() == e.BUTTON1 && h.strely >= 2) {
            this.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/morhuhnt_maly_MrtvaL.png")));
            if (pada != true) {
                s = new skore(this.getX(), this.getY(), j);
                j.add(s);
                killed();
                h.skore += 70;
                pohybd();
            }
            pada = true;
        }
        if (e.getButton() == e.BUTTON3 && h.strely <= 1) {
            h.nabi();
        }
        h.mousePressed(e);
    }
}
